package com.example.blog.dao;

import com.example.blog.pojo.Comment;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CommentRepository extends JpaRepository<Comment,Long> {
    @Query("select c from Comment c where c.blog.id = ?1 and c.ParentComment = null")
    List<Comment> myfindByBlogId(Long blogId, Sort sort);
}
